package org.example.demo;

import java.io.FileReader;
import java.io.FileWriter;

/**
 * @ClassName zfCopyDemo
 * @Description
 * @Author zhangsw
 * @Date 2020/11/9 16:52
 * @Version 1.0
 */
public class zfCopyDemo {
    public static void main(String[] args) throws Exception {
        FileReader reader = new FileReader("ccc.txt");
        FileWriter writer = new FileWriter("ddd.txt");
        char[] buffer = new char[1024];
        int len = 0;
        while ((len = reader.read(buffer)) != -1) {
            writer.write(buffer, 0, len);
        }
        writer.close();
        reader.close();
    }
}
